using System;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;
namespace utils
{
	public class code : UserControl
	{
		private Container components = null;
		public code()
		{
			this.InitializeComponent();
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		public static string encode(string i)
		{
			StringBuilder stringBuilder = new StringBuilder();
			char[] array = i.ToCharArray();
			for (int j = 0; j < array.Length; j++)
			{
				stringBuilder.Append((int)array[j] ^ j << 2);
				stringBuilder.Append(";");
			}
			return stringBuilder.ToString();
		}
		public static string decode(string i)
		{
			StringBuilder stringBuilder = new StringBuilder();
			string[] array = i.Split(new char[]
			{
				';'
			});
			for (int j = 0; j < array.Length - 1; j++)
			{
				stringBuilder.Append((char)(int.Parse(array[j]) ^ j << 2));
			}
			return stringBuilder.ToString();
		}
		private void InitializeComponent()
		{
			this.components = new Container();
		}
	}
}
